package com.qdcadc.data_coll_service_consumer.controller;

import com.alibaba.fastjson.JSONObject;
import com.qdcadc.service.DataForwardService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DataCollController {
    @Reference(url = "dubbo://localhost:20883")
    DataForwardService dataForwardService;

    @GetMapping("/collData")
    public String collData(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("key","hello");
        dataForwardService.sendRealTimeDataToCloud(jsonObject);
        return "success";
    }
}
